In data communications networks, a large number of methods are used to encapsulate communication data packets such as OSI (Open Systems Interconnect) layer 3 TCP/IP packets for the purpose of transmission over local or layer 2 networks and over specific point to point layer 1 physical links. Examples of OSI layer 2 network encapsulation and transmission and access control methods include 10 Mb Ethernet, 100 Mb Ethernet, gigabit Ethernet (IEEE 802.3z), IEEE 802.1Q, IEEE 802.3x, FDDI (ANSI X3T9.5), and token ring (IEEE 802.5). There are also a large number of methods to encapsulate layer 3 packets for transmission over layer 2 networks. For point to point links, available encapsulations include PPP over HDLC (RFC1661), and Packet over Sonet (IETF RFC1619).
In a generic Ethernet packet, the header information that is immediately needed for a switching decision is the layer 2 media access control (MAC) source and destination addresses and, optional 802.1Q tag information. For an IP packet, routing information is contained in the IP source and destination addresses. The MAC source and destination addresses are used for layer 2 switching, wherein the destination address is matched with the port having previously received a source address of the same value. The layer 2 source and destination information is readily available in the first 12 bytes of the Ethernet packet, and generally presents no challenge in extraction. Higher level layer 3 Internet Protocol (IP), and other types of protocol packets present somewhat greater difficulty. For IP, a 32 bit IP source and 32 bit IP destination address are needed for the routing decision, and the hardware must go through a decision tree to determine what type of packet is being examined, what protocol type it is, and thereafter extract addressing information. Virtual Local Area Network (VLAN) information may be added indicating which VLAN the packet has membership. Each switch keeps a copy of a table with the VLAN value associated with a port of exit. When a packet bearing this VLAN value arrives, a hardware-based lookup is performed into a table, which yields the associated port of exit for the packet. If the decision tree determines that the packet is not of a supported type, then the treatment reverts back to the layer 2 switching treatment of a simple Ethernet packet, and the time spent examining the packet is lost. Additionally, for each separate protocol, such as IP, IPX, Appletalk, etc., this examination of the packet must occur, and the information will appear in different places and formats in the packet. It would be useful to have a single method of access for the transmission and reception of switching and routing information for such data packets including a common header format.